# !/usr/bin/env python3
# -*- coding: utf-8 -*-
# aim:    
# author: wangkaixuan
# email:  26554189525@qq.com 
# date:   2018/1/10

import sqlite3
conn = sqlite3.connect('test.db')
cursor = conn.cursor()
cursor.execute('create table user(id varchar(20) primary key,name varchar(20))')
cursor.execute('insert into user(id,name) values(\'1\',\'wangkaixuan\')')
print('rowcount=',cursor.rowcount)
cursor.close()
conn.commit()
conn.close()

conn1 = sqlite3.connect('test.db')
cursor = conn1.cursor()
cursor.execute('select * from user where id = ?','1')
values = cursor.fetchall()
print(values)
cursor.close()
conn1.close()